﻿using System;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using MapInfo.Toolbox.Core;

namespace MapInfo.Toolbox.UI.ViewModels
{
    public class StatusViewModel : ViewModelBase
    {
        public StatusViewModel(IMessenger messenger)
        {
            base.MessengerInstance = messenger;

            base.MessengerInstance.Register<UpdateModuleStatusArgs>(this,this.StatusUpdated);

            this.Messages = new ObservableCollection<string>();
        }

        public ObservableCollection<String> Messages { get; set; }

        private void StatusUpdated(UpdateModuleStatusArgs obj)
        {
            this.Messages.Add(obj.Message);
        }
    }
}
